import {HTagProps} from "@/components/ant-ext/HTag";

export class Const {
    select: { value: any, title: string }[]
    tag: HTagProps["mapping"]

    constructor(list: [key: any, text: string, color?: string][]) {
        this.tag = {}
        this.select = []
        for (let i in list) {
            const [key, text, color] = list[i]

            this.tag[key] = {text, color}
            this.select.push({title: text, value: key})
        }
    }
}


export const MenuType = new Const([
    [1, "链接", ""],
    [2, "菜单", ""],
    [3, "按钮", ""],
])
export const InnerPath = new Const([
    [true, "内部地址", ""],
    [false, "外部地址", ""],
])

export const Stat = new Const([
    [true, "启用", "blue"],
    [false, "禁用", "red"],
])

export const AdminStat = new Const([
    [1, "启用", "blue"],
    [0, "禁用", "red"],
])
export const AdminType = new Const([
    [1, "中采通用户", "blue"],
    [2, "银行用户", "red"],
    [3, "企业用户", "warning"],
])

export const ClientTypeList = new Const([
    ["module", "模块", "blue"],
    ["menu", "菜单", "red"],
    ["button", "按钮", "warning"],
    ["interface", "接口", "warning"],
])

export const AdminSex = new Const([
    [0, "男", ""],
    [1, "女", ""],
])

export const FieldType = new Const([
    ["1", "文本框", "blue"],
    ["3", "图片或文件", "blue"],
])

export const RequiredType = new Const([
    [true, "必填", "blue"],
    [false, "选填", "warning"],
])

// 要改走接口
export const EnptTypeTag = new Const([
    ["1", "上市公司", "blue"],
    ["2", "合资企业", "warning"],
    ["3", "国营企业", "warning"],
])